# scripts/download_model.py
from huggingface_hub import snapshot_download
import os


def download_qwen_vl():
    repo_id = "Qwen/Qwen2.5-VL-3B-Instruct"
    local_dir = "./models/Qwen2.5-VL-3B-Instruct"

    if not os.path.exists(local_dir):
        os.makedirs(local_dir)

    print(f"正在从 Hugging Face 下载 {repo_id} 到 {local_dir}...")

    snapshot_download(
        repo_id=repo_id,
        local_dir=local_dir,
        ignore_patterns=["*.pt", "*.bin"],  # 可选：忽略某些格式
        max_workers=8
    )
    print("✅ 下载完成！")


if __name__ == "__main__":
    download_qwen_vl()